package cn.liangxxhu.rocketmq.param;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;

import java.util.Map;

@Data
@Schema(description = "搜索请求参数")
public class SearchRequest {
    @Schema(description = "搜索关键词")
    private String keyword;

    @Schema(description = "分页页码，从1开始")
    @Min(value = 1, message = "页码不能小于1")
    private Integer pageNum = 1;

    @Schema(description = "每页条数")
    private Integer pageSize;

    @Schema(description = "排序字段")
    private String sortField;

    @Schema(description = "排序方向: asc/desc")
    private String sortDirection = "desc";

    @Schema(description = "过滤条件，key为字段名，value为值")
    private Map<String, Object> filters;

    @Schema(description = "范围查询条件，key为字段名，value为{min:值, max:值}")
    private Map<String, Map<String, Object>> rangeFilters;
}
